package com.mxx.springaction;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.*;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;

/**
 * @author xiaoxu.ma
 * @date 2021/11/11 14:42
 */
@Configuration
@EnableAspectJAutoProxy
@PropertySource("classpath:a.properties")
public class CDplayerConfig {

    @Bean
    public Audience audience() {
        return new Audience();
    }

    @Bean
    public Performance performance() {
        return new Performance("mxxxxxx");
    }

    @Bean
    public CompactDisc sgtpeper() {
        return new Sgtpeper();
    }

    @Bean
    public CDPlayer cdPlayer(CompactDisc compactDisc, @Value(value = "${aa}") String ss) {
        return new CDPlayer(compactDisc, ss);
    }

    @Bean
    public PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
        return new PropertySourcesPlaceholderConfigurer();
    }

}
